scripts: setlocalversion: safely extract variables from auto.conf using awk
authorPhilipp Tomsich <[email protected]>
Tue, 8 Aug 2017 13:26:12 +0000 (15:26 +0200)
committerPhilipp Tomsich <[email protected]>
Sun, 13 Aug 2017 15:15:08 +0000 (17:15 +0200)
commit81630a3b38c22102dce3a15019db546af209344d
treebc004b314fb1252ddd0035ceadee5989038d85c3
parent18d38d3a9484b34046d49dc212288588ce1d8db2
scripts: setlocalversion: safely extract variables from auto.conf using awk

Moving SPL_LDSCRIPT to Kconfig triggered an unfortunate attempt of
command substitution, as the sourced auto.conf may include $(ARCH)
which tries to execute a command 'ARCH'.
This showed up as a warning similar to the following:
  include/config/auto.conf: line 209: ARCH: command not found

This change does no longer attempt to source auto.conf, but rather
passes it through awk to retrieve the values for CONFIG_LOCALVERSION
and CONFIG_LOCALVERSION_AUTO.  This will also mitigate the risk of
unintended command substitution.

Signed-off-by: Philipp Tomsich <[email protected]>
Reported-by: Andy Yan <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Reviewed-by: Klaus Goger <[email protected]>
Reviewed-by: Jakob Unterwurzacher <[email protected]>
scripts/setlocalversion